package com.seres.data;

import java.util.ArrayList;
import java.util.List;

public class Answer {
	private int answerId;
	
	private String fullDescription;
	private String shortDescription;
	
	private List<IndexImpact> indexImpacts;
	private List<StakeholderImpact> stakeholderImpacts;
	
	private boolean risky;
	private boolean corrective;
	
	private Scenario nextScenario;
	
	Answer(){
		
	}
	
	public Answer(String fullDescription, String shortDescription, List<IndexImpact> indexImpacts, List<StakeholderImpact> stakeholderImpacts,
			boolean risky,boolean corrective,Scenario nextScenario){
		setFullDescription(fullDescription);
		setShortDescription(shortDescription);
		setIndexImpacts(indexImpacts);
		setStakeholderImpacts(stakeholderImpacts);
		setRisky(risky);
		setCorrective(corrective);
		setNextScenario(nextScenario);
	}
	public int getAnswerId() {
		return answerId;
	}

	public void setAnswerId(int answerId) {
		this.answerId = answerId;
	}

	public String getFullDescription() {
		return fullDescription;
	}

	public void setFullDescription(String fullDescription) {
		this.fullDescription = fullDescription;
	}

	public String getShortDescription() {
		return shortDescription;
	}

	public void setShortDescription(String shortDescription) {
		this.shortDescription = shortDescription;
	}

	public boolean isRisky() {
		return risky;
	}

	public void setRisky(boolean risky) {
		this.risky = risky;
	}

	public boolean isCorrective() {
		return corrective;
	}

	public void setCorrective(boolean corrective) {
		this.corrective = corrective;
	}

	public Scenario getNextScenario() {
		return nextScenario;
	}

	public void setNextScenario(Scenario nextScenario) {
		this.nextScenario = nextScenario;
	}

	public List<IndexImpact> getIndexImpacts() {
		return indexImpacts;
	}

	public void setIndexImpacts(List<IndexImpact> indexImpacts) {
		this.indexImpacts = indexImpacts;
	}

	public List<StakeholderImpact> getStakeholderImpacts() {
		return stakeholderImpacts;
	}
	public List<StakeholderImpact> getStakeholderImpactsClone(){
		ArrayList<StakeholderImpact> stakeholderImpactsClone = new ArrayList<StakeholderImpact>();
		stakeholderImpactsClone.addAll(getStakeholderImpacts());
		return stakeholderImpactsClone;
	}

	public void setStakeholderImpacts(List<StakeholderImpact> stakeholderImpacts) {
		this.stakeholderImpacts = stakeholderImpacts;
	}
	public StakeholderImpact getStakeholderImpact(Stakeholder stakeholder){
		for(StakeholderImpact impact : getStakeholderImpacts()){
			if(impact.getStakeholder().equals(stakeholder)){
				return impact;
			}
		}
		return null;
	}
	public boolean equals(Object answer){
		return ((Answer) answer).getAnswerId() == this.getAnswerId();
		
	}
}
